import Admonition from "@theme/Admonition";
import CodeBlock from "@theme/CodeBlock";

import ComponentConfiguration from "@site/src/pages/components-explorer/_components/ComponentConfiguration";
import ComponentHeader from "@site/src/pages/components-explorer/_components/ComponentHeader";
import ComponentTroubleshooting from "@site/src/pages/components-explorer/_components/ComponentTroubleshooting/index.mdx";
import FaceRecognition from "@site/src/pages/components-explorer/_domains/face_recognition/index.mdx";
import ObjectDetector from "@site/src/pages/components-explorer/_domains/object_detector/index.mdx";

import ComponentMetadata from "./_meta";
import config from "./config.json";

<ComponentHeader meta={ComponentMetadata} />

DeepStack is a self-hosted, free and open source AI server that provides object detection and face recognition, among other functions.<br/>
It is highly optimized and runs on a pleathora of devices and platforms.<br/>
Below is quoted from DeepStacks [documentation](https://docs.deepstack.cc/index.html):

> DeepStack is an AI server that empowers every developer in the world to easily build state-of-the-art AI systems both on premise and in the cloud. The promises of Artificial Intelligence are huge but becoming a machine learning engineer is hard. DeepStack is device and language agnostic. You can run it on Windows, Mac OS, Linux, Raspberry PI and use it with any programming language.<br/>
> DeepStack's source code is available on GitHub via https://github.com/johnolafenwa/DeepStack<br/>
> DeepStack is developed and maintained by [DeepQuest AI](https://deepquestai.com/)

## Configuration

<details>
  <summary>Configuration example</summary>

```yaml title="/config/config.yaml"
deepstack:
  host: deepstack
  port: 5000
  object_detector:
    cameras:
      camera_one:
        scan_on_motion_only: false
        fps: 1
        labels:
          - label: person
            confidence: 0.8
          - label: cat
            confidence: 0.8
  face_recognition:
    save_unknown_faces: false
    cameras:
      camera_one:
    labels:
      - person
```

</details>

<ComponentConfiguration config={config} />

<ObjectDetector
  meta={ComponentMetadata}
  showLabels={false}
  extras={
    <Admonition type="tip">
      These are the labels available in the default DeepStack model:
      <CodeBlock language="bash">
        person, bicycle, car, motorcycle, airplane, bus, train, truck, boat,
        traffic light, fire hydrant, stop_sign, parking meter, bench, bird, cat,
        dog, horse, sheep, cow, elephant, bear, zebra, giraffe, backpack,
        umbrella, handbag, tie, suitcase, frisbee, skis, snowboard, sports ball,
        kite, baseball bat, baseball glove, skateboard, surfboard, tennis
        racket, bottle, wine glass, cup, fork, knife, spoon, bowl, banana,
        apple, sandwich, orange, broccoli, carrot, hot dog, pizza, donut, cake,
        chair, couch, potted plant, bed, dining table, toilet, tv, laptop,
        mouse, remote, keyboard, cell phone, microwave, oven, toaster, sink,
        refrigerator, book, clock, vase, scissors, teddy bear, hair dryer,
        toothbrush.
      </CodeBlock>
    </Admonition>
  }
/>

<FaceRecognition />

<ComponentTroubleshooting meta={ComponentMetadata} />
